<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>DSpace Documentation : Discovery</title>
	    <link rel="stylesheet" href="styles/site.css" type="text/css" />
        <META http-equiv="Content-Type" content="text/html; charset=UTF-8">	    
    </head>

    <body>
	    <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#ffffff">
		    <tr>
			    <td valign="top" class="pagebody">
				    <div class="pageheader">
					    <span class="pagetitle">
                            DSpace Documentation : Discovery
                                                    </span>
				    </div>
				    <div class="pagesubheading">
					    This page last changed on Dec 16, 2010 by <font color="#0050B2">bram</font>.
				    </div>

				    <h1><a name="Discovery-DSpaceDiscovery"></a>DSpace Discovery</h1>

<style type='text/css'>/*<![CDATA[*/
div.rbtoc1292517822148 {margin-left: 0px;padding: 0px;}
div.rbtoc1292517822148 ul {list-style: none;margin-left: 0px;}
div.rbtoc1292517822148 li {margin-left: 0px;padding-left: 0px;}

/*]]>*/</style><div class='rbtoc1292517822148'>
<ul>
    <li><span class='TOCOutline'>1</span> <a href='#Discovery-IntroductionVideo'> Introduction Video</a></li>
    <li><span class='TOCOutline'>2</span> <a href='#Discovery-UsageGuidelines'>Usage Guidelines</a></li>
    <li><span class='TOCOutline'>3</span> <a href='#Discovery-InstructionsforenablingDiscoveryinDSpace1.7.0'>Instructions for enabling Discovery in DSpace 1.7.0</a></li>
    <li><span class='TOCOutline'>4</span> <a href='#Discovery-InstructionsforConfiguringDiscovery'>Instructions for Configuring Discovery</a></li>
<ul>
    <li><span class='TOCOutline'>4.1</span> <a href='#Discovery-ConfiguringFacetsthatareExposedforSearchResults'>Configuring Facets that are Exposed for Search Results</a></li>
    <li><span class='TOCOutline'>4.2</span> <a href='#Discovery-AdvancedConfigurationinSolr'>Advanced Configuration in Solr</a></li>
</ul>
</ul></div>

<h2><a name="Discovery-IntroductionVideo"></a><a href="http://www.youtube.com/v/abRSXTUEwws">Introduction Video</a></h2>

<h2><a name="Discovery-UsageGuidelines"></a>Usage Guidelines</h2>

<p>The Discovery Module enables faceted searching for your repository.</p>

<p>In a faceted search, a user can filter what they are looking for by grouping entries into a facet, and drill down to find the content they are interested in.&nbsp;<br/>
So instead of user searching: [ wetland + "dc.author=Mitsch, William J" + dc.subject="water quality" ], they can instead do their initial search, [ wetland ], and then filter the results by attributes.</p>

<p>Although these techniques are new in DSpace, they might feel familiar from other platforms like Aquabroser or Amazon, where facets help you to select the right product according to facets like price and brand. DSpace Discovery offers very powerful browse and search configurations that were only possible with code customization in the past.</p>

<h2><a name="Discovery-InstructionsforenablingDiscoveryinDSpace1.7.0"></a>Instructions for enabling Discovery in DSpace 1.7.0</h2>

<p>As with any upgrade&nbsp;procedure, it is highly&nbsp;recommend&nbsp;that you backup your existing data thoroughly. &nbsp;This includes cases where upgrading DSpace from 1.6.2 to 1.7.0. &nbsp;Although upgrades in versions of Solr/Lucene do tend to be forwards&nbsp;compatible&nbsp;for the data stored in the Lucene index, it is always a best practice to backup your&nbsp;﻿dspace.dir/solr/statistics cores to assure no data is lost.</p>


<ol>
	<li>Enable the Discovery Aspects in the XMLUI by changing the following settings in ﻿config/xmlui.xconf
	<ol>
		<li>Comment out: SearchArtifacts</li>
		<li>Uncomment: Discovery
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-xml"><span class="code-tag">&lt;xmlui&gt;</span>
    <span class="code-tag">&lt;aspects&gt;</span>
        <span class="code-tag">&lt;aspect name=<span class="code-quote">"Artifact Browser"</span> path=<span class="code-quote">"resource://aspects/ArtifactBrowser/"</span> /&gt;</span>
        <span class="code-tag">&lt;aspect name=<span class="code-quote">"Browsing Artifacts"</span> path=<span class="code-quote">"resource://aspects/BrowseArtifacts/"</span> /&gt;</span>
        <span class="code-tag"><span class="code-comment">&lt;!--&lt;aspect name=<span class="code-quote">"Searching Artifacts"</span> path=<span class="code-quote">"resource://aspects/SearchArtifacts/"</span> /&gt;</span>--&gt;</span>
        <span class="code-tag">&lt;aspect name=<span class="code-quote">"Administration"</span> path=<span class="code-quote">"resource://aspects/Administrative/"</span> /&gt;</span>
        <span class="code-tag">&lt;aspect name=<span class="code-quote">"E-Person"</span> path=<span class="code-quote">"resource://aspects/EPerson/"</span> /&gt;</span>
        <span class="code-tag">&lt;aspect name=<span class="code-quote">"Submission and Workflow"</span> path=<span class="code-quote">"resource://aspects/Submission/"</span> /&gt;</span>
	<span class="code-tag">&lt;aspect name=<span class="code-quote">"Statistics"</span> path=<span class="code-quote">"resource://aspects/Statistics/"</span> /&gt;</span>

        &lt;!--
            To enable Discovery, uncomment this Aspect that will enable it
            within your existing XMLUI
            Also make sure to comment the SearchArtifacts aspect
            as leaving it on together with discovery will cause UI overlap issues--&gt;
        <span class="code-tag">&lt;aspect name=<span class="code-quote">"Discovery"</span> path=<span class="code-quote">"resource://aspects/Discovery/"</span> /&gt;</span>


        &lt;!--
            This aspect tests the various possible DRI features,
            it helps a theme developer create themes
        --&gt;
        <span class="code-tag"><span class="code-comment">&lt;!-- &lt;aspect name=<span class="code-quote">"XML Tests"</span> path=<span class="code-quote">"resource://aspects/XMLTest/"</span>/&gt;</span> --&gt;</span>
    <span class="code-tag">&lt;/aspects&gt;</span>
</pre>
</div></div></li>
	</ol>
	</li>
	<li>Enable the Discovery Indexing Consumer that will update Discovery Indexes on changes to content in XMLUI, JSPUI, SWORD, and LNI in config/dspace.cfg
	<ol>
		<li>Add discovery to the list of event.dispatcher.default.consumers</li>
		<li>Change recent.submissions.count to zero
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">#### Event <span class="code-object">System</span> Configuration ####

# <span class="code-keyword">default</span> synchronous dispatcher (same behavior as traditional DSpace)
event.dispatcher.<span class="code-keyword">default</span>.class = org.dspace.event.BasicDispatcher
#event.dispatcher.<span class="code-keyword">default</span>.consumers = search, browse, eperson, harvester
event.dispatcher.<span class="code-keyword">default</span>.consumers = search, browse, discovery, eperson, harvester

#Put the recent submissions count to 0 so that discovery can use it's recent submissions,
# not doing <span class="code-keyword">this</span> when discovery is enabled will cause UI overlap issues
#How many recent submissions should be displayed at any one time
#recent.submissions.count = 5
recent.submissions.count = 0
</pre>
</div></div></li>
	</ol>
	</li>
	<li>Check that the port is correct for solr.search.server in config/dspace-solr-search.cfg
	<ol>
		<li>If all of your traffic runs over port 80, then you need to remove the port from the URL
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">##### Search Indexing #####
solr.search.server = http:<span class="code-comment">//localhost/solr/search</span>
</pre>
</div></div></li>
	</ol>
	</li>
	<li>From the command line, navigate to the dspace directory and run the command below to index the content of your DSpace instance into Discovery.
<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">./bin/dspace update-discovery-index
</pre>
</div></div>
<div class="panel" style="border-width: 1px;"><div class="panelContent">
<p> NOTE: This step may take some time if you have a large number of items in your repository.</p>
</div></div></li>
</ol>


<h2><a name="Discovery-InstructionsforConfiguringDiscovery"></a>Instructions for Configuring Discovery</h2>

<p>Discovery can be configured at multiple levels of the application. Outlined below will be where in Discovery changes can be made that will alter the presentation. The primary place that the user&nbsp;experience&nbsp;is altered in XMLUi is through the <b>dspace-solr-search.cfg</b> file</p>

<h3><a name="Discovery-ConfiguringFacetsthatareExposedforSearchResults"></a>Configuring Facets that are Exposed for Search Results</h3>

<div class='table-wrap'>
<table class='confluenceTable'><tbody>
<tr>
<td class='confluenceTd'> Property: </td>
<td class='confluenceTd'> solr.search.server </td>
</tr>
<tr>
<td class='confluenceTd'> Example Value: </td>
<td class='confluenceTd'> <a href="http://localhost:8080/solr/search">http://localhost:8080/solr/search</a> </td>
</tr>
<tr>
<td class='confluenceTd'> Informational Note: </td>
<td class='confluenceTd'> Discovery relies on a SOLR index. This parameter determines the location of the SOLR index. </td>
</tr>
<tr>
<td class='confluenceTd'> Property: </td>
<td class='confluenceTd'> solr.facets.search </td>
</tr>
<tr>
<td class='confluenceTd'> Example Value: </td>
<td class='confluenceTd'> solr.facets.search=dc.contributor.author,dc.subject,dc.date.issued_dt </td>
</tr>
<tr>
<td class='confluenceTd'> Informational Note: </td>
<td class='confluenceTd'> The Discovery search facets, offered in the navigation bar, can be customized for each specific page in DSpace. When no specification is given for a page, this default configuration is used. Every SOLR facet field which ends with &#95;dt will be handled as a date. Handeling as date implies that (field.name).year will be used for faceting </td>
</tr>
<tr>
<td class='confluenceTd'> Property: </td>
<td class='confluenceTd'> solr.facets.site </td>
</tr>
<tr>
<td class='confluenceTd'> Example Value: </td>
<td class='confluenceTd'> solr.facets.site=dc.contributor.author,dc.subject,dc.date.issued_dt </td>
</tr>
<tr>
<td class='confluenceTd'> Informational Note: </td>
<td class='confluenceTd'> Defines the facet fields, offered on the DSpace homepage </td>
</tr>
<tr>
<td class='confluenceTd'> Property: </td>
<td class='confluenceTd'> solr.facets.community </td>
</tr>
<tr>
<td class='confluenceTd'> Example Value: </td>
<td class='confluenceTd'> solr.facets.community=dc.contributor.author,dc.subject,dc.date.issued_dt </td>
</tr>
<tr>
<td class='confluenceTd'> Informational Note: </td>
<td class='confluenceTd'> Defines the facet fields, offered on community homepages </td>
</tr>
<tr>
<td class='confluenceTd'> Property: </td>
<td class='confluenceTd'> solr.facets.collection </td>
</tr>
<tr>
<td class='confluenceTd'> Example Value: </td>
<td class='confluenceTd'> solr.facets.collection=dc.contributor.author,dc.subject,dc.date.issued_dt </td>
</tr>
<tr>
<td class='confluenceTd'> Informational Note: </td>
<td class='confluenceTd'> Defines the facet fields, offered on collection homepages </td>
</tr>
<tr>
<td class='confluenceTd'> Property: </td>
<td class='confluenceTd'> solr.facets.item </td>
</tr>
<tr>
<td class='confluenceTd'> Example Value: </td>
<td class='confluenceTd'> solr.facets.item=dc.contributor.author,dc.subject,dc.date.issued_dt </td>
</tr>
<tr>
<td class='confluenceTd'> Informational Note: </td>
<td class='confluenceTd'> Defines the facet fields, offered on item pages </td>
</tr>
<tr>
<td class='confluenceTd'> Property: </td>
<td class='confluenceTd'> solr.default.filterQuery </td>
</tr>
<tr>
<td class='confluenceTd'> Example Value: </td>
<td class='confluenceTd'> solr.default.filterQuery=location:l2 </td>
</tr>
<tr>
<td class='confluenceTd'> Informational Note: </td>
<td class='confluenceTd'> Aside from filters that are applied when users are searching, filters can also be applied by default. This property allos to define default filters that are used for every search in Discovery. The syntax is metadatafieldname:value. <b>location</b> is a special example, used to restrict a search to certain communities and collections. l stands for collection, while m is used to restrict the search to a community. The numbers, written after l or m is the internal database ID of the collection or community </td>
</tr>
<tr>
<td class='confluenceTd'> Property: </td>
<td class='confluenceTd'> solr.site.default.filterQuery </td>
</tr>
<tr>
<td class='confluenceTd'> Example Value: </td>
<td class='confluenceTd'> solr.site.default.filterQuery=dc.contributor.author:Kevin&#42; </td>
</tr>
<tr>
<td class='confluenceTd'> Informational Note: </td>
<td class='confluenceTd'> This parameter applies additional filters on the Recently Added list, shown on the DSpace homepage. As these filters are strict matches, the star in the example is used to filter on all dc.contributor.author values that start with Kevin </td>
</tr>
<tr>
<td class='confluenceTd'> Property: </td>
<td class='confluenceTd'> solr.community.default.filterQuery </td>
</tr>
<tr>
<td class='confluenceTd'> Example Value: </td>
<td class='confluenceTd'> solr.community.default.filterQuery=dc.contributor.author:Kevin&#42; </td>
</tr>
<tr>
<td class='confluenceTd'> Informational Note: </td>
<td class='confluenceTd'> This parameter applies additional filters on the Recently Added list, shown on Community Homepages. As these filters are strict matches, the star in the example is used to filter on all dc.contributor.author values that start with Kevin </td>
</tr>
<tr>
<td class='confluenceTd'> Property: </td>
<td class='confluenceTd'> solr.collection.default.filterQuery </td>
</tr>
<tr>
<td class='confluenceTd'> Example Value: </td>
<td class='confluenceTd'> solr.collection.default.filterQuery=dc.contributor.author:Kevin&#42; </td>
</tr>
<tr>
<td class='confluenceTd'> Informational Note: </td>
<td class='confluenceTd'> This parameter applies additional filters on the Recently Added list, shown on Collection Homepages. As these filters are strict matches, the star in the example is used to filter on all dc.contributor.author values that start with Kevin </td>
</tr>
<tr>
<td class='confluenceTd'> Property: </td>
<td class='confluenceTd'> solr.search.default.filterQuery </td>
</tr>
<tr>
<td class='confluenceTd'> Example Value: </td>
<td class='confluenceTd'> solr.search.default.filterQuery=dc.embargo:lifted </td>
</tr>
<tr>
<td class='confluenceTd'> Informational Note: </td>
<td class='confluenceTd'> This parameter applies additional filters on all Discovery searches. In this example, only items who have the value <b>lifted</b> in the embargo field, are being shown as search results. </td>
</tr>
<tr>
<td class='confluenceTd'> Property: </td>
<td class='confluenceTd'> solr.search.filters </td>
</tr>
<tr>
<td class='confluenceTd'> Example Value: </td>
<td class='confluenceTd'> dc.title, dc.contributor.author, dc.subject, dc.date.issued.year </td>
</tr>
<tr>
<td class='confluenceTd'> Informational Note: </td>
<td class='confluenceTd'> Defines which fields are shown in the (advanced) search form. </td>
</tr>
<tr>
<td class='confluenceTd'> Property: </td>
<td class='confluenceTd'> solr.search.sort </td>
</tr>
<tr>
<td class='confluenceTd'> Example Value: </td>
<td class='confluenceTd'> solr.search.sort=dc.title, dc.date.issued_dt </td>
</tr>
<tr>
<td class='confluenceTd'> Informational Note: </td>
<td class='confluenceTd'> Defines which indexed fields can be sorted on in the search results. With this parameter it's possible to make any field available for sorting. </td>
</tr>
<tr>
<td class='confluenceTd'> Property: </td>
<td class='confluenceTd'> solr.index.type.date </td>
</tr>
<tr>
<td class='confluenceTd'> Example Value: </td>
<td class='confluenceTd'> solr.index.type.date=dc.date,dc.date.&#42; </td>
</tr>
<tr>
<td class='confluenceTd'> Informational Note: </td>
<td class='confluenceTd'> Defines whichs fields are indexed as dates. Please be aware that for each date field an &#95;dt will be suffixed so that dc.date.issued will become dc.date.issued_dt. For each date indexed the year will also be stored separately in a (field.name).year so it can be used for date faceting </td>
</tr>
<tr>
<td class='confluenceTd'> Property: </td>
<td class='confluenceTd'> solr.recent-submissions.size </td>
</tr>
<tr>
<td class='confluenceTd'> Example Value: </td>
<td class='confluenceTd'> solr.recent-submissions.size=5 </td>
</tr>
<tr>
<td class='confluenceTd'> Informational Note: </td>
<td class='confluenceTd'> Defines the number of items that are shown in the Recently Added lists. </td>
</tr>
<tr>
<td class='confluenceTd'> Property: </td>
<td class='confluenceTd'> recent.submissions.sort-option </td>
</tr>
<tr>
<td class='confluenceTd'> Example Value: </td>
<td class='confluenceTd'> recent.submissions.sort-option=dc.date.accessioned_dt </td>
</tr>
<tr>
<td class='confluenceTd'> Informational Note: </td>
<td class='confluenceTd'> The indexed metadata field on which Discovery sorts to determine which items were recently submitted </td>
</tr>
<tr>
<td class='confluenceTd'> Property: </td>
<td class='confluenceTd'> search.facet.max </td>
</tr>
<tr>
<td class='confluenceTd'> Example Value: </td>
<td class='confluenceTd'> search.facet.max=10 </td>
</tr>
<tr>
<td class='confluenceTd'> Informational Note: </td>
<td class='confluenceTd'> Use the property below to limit the number of facet filters in the side of the search page </td>
</tr>
</tbody></table>
</div>


<h3><a name="Discovery-AdvancedConfigurationinSolr"></a>Advanced Configuration in Solr</h3>

<p>Solr itself now runs two cores. &nbsp;One for collection DSpace Solr based "statistics", the other for Discovery Solr based "search"</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="code-java">solr
├── search
│   ├── conf
│   │   ├── admin-extra.html
│   │   ├── elevate.xml
│   │   ├── protwords.txt
│   │   ├── schema.xml
│   │   ├── scripts.conf
│   │   ├── solrconfig.xml
│   │   ├── spellings.txt
│   │   ├── stopwords.txt
│   │   ├── synonyms.txt
│   │   └── xslt
│   │       ├── DRI.xsl
│   │       ├── example.xsl
│   │       ├── example_atom.xsl
│   │       ├── example_rss.xsl
│   │       └── luke.xsl
│   └── conf2
├── solr.xml
└── statistics
    └── conf
        ├── admin-extra.html
        ├── elevate.xml
        ├── protwords.txt
        ├── schema.xml
        ├── scripts.conf
        ├── solrconfig.xml
        ├── spellings.txt
        ├── stopwords.txt
        ├── synonyms.txt
        └── xslt
            ├── example.xsl
            ├── example_atom.xsl
            ├── example_rss.xsl
            └── luke.xsl
</pre>
</div></div>

				    
                    			    </td>
		    </tr>
	    </table>
	    <table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr>
				<td height="12" background="https://wiki.duraspace.org/images/border/border_bottom.gif"><img src="images/border/spacer.gif" width="1" height="1" border="0"/></td>
			</tr>
		    <tr>
			    <td align="center"><font color="grey">Document generated by Confluence on Mar 25, 2011 19:21</font></td>
		    </tr>
	    </table>
    </body>
</html>